<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改需求单')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-require-edit" th:object="${lmRequire}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">需求分类：</label>
                <div class="col-sm-8">
                    <input name="userId" th:field="*{requireTypeName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户：</label>
                <div class="col-sm-8">
                    <input name="userId" th:field="*{userName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">需求标题：</label>
                <div class="col-sm-8">
                    <input name="requireTitle" th:field="*{requireTitle}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">需求发布省份：</label>
                <div class="col-sm-8">
                    <input name="requireProvince" th:field="*{provinceName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">需求发布城市：</label>
                <div class="col-sm-8">
                    <input name="requireCity" th:field="*{cityName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">需求发布区域：</label>
                <div class="col-sm-8">
                    <input name="requireDist" th:field="*{distName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">需求内容：</label>
                <div class="col-sm-8">
                    <input name="isNoname" th:field="*{requireContent}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <input name="bannerPic" th:field="*{requireImages}" type="hidden">
                <label class="font-noraml">需求图片</label>
                <div class="file-loading">
                    <input id="fileinput-demo-1" type="file" multiple data-min-file-count="1" data-max-file-count="1" data-theme="fas">
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">需求描述：</label>
                <div class="col-sm-8">
                    <input name="requireDesc" th:field="*{requireDesc}" class="form-control" type="text">
                </div>
            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">需求预算：</label>
                <div class="col-sm-8">
                    <input name="requirePrice" th:field="*{requirePrice}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">需求联系方式：</label>
                <div class="col-sm-8">
                    <input name="requireTel" th:field="*{requireTel}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">选择联系方式：</label>
                <div class="col-sm-8">
                    <input name="requireChoice" th:field="*{requireChoice}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否匿名：</label>
                <div class="col-sm-8">
                    <input name="isNoname" th:field="*{isNoname}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script th:inline="javascript">
        var prefix = ctx + "lm/require";
        var images = $("#requireImages").val().split(",");
        debugger;
        $(document).ready(function () {
            debugger;
            $("#fileinput-demo-1").fileinput({
                'uploadUrl': '#',
                overwriteInitial: true,
                initialPreviewAsData: true,
                showUpload:false,
                initialPreview: images
            });
        });

        $("#form-require-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-require-edit').serialize());
            }
        }
    </script>
</body>
</html>